package com.lc.controller;


import com.cnpc.framework.base.entity.BaseResponse;
import com.cnpc.framework.base.entity.Dict;
import com.cnpc.framework.base.utils.HttpClient;
import com.cnpc.framework.utils.*;
import com.google.gson.Gson;
import com.lc.entity.*;
import com.lc.service.AppService;
import com.lc.service.LogService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.net.URI;
import java.util.*;

@RequestMapping("/app")
@Controller
public class AppController {

    private Logger logger = LoggerFactory.getLogger(getClass());
    @Autowired
    AppService appService;

    @Autowired
    LogService logService;

    @RequestMapping(value = "/saveChildren")
    @ResponseBody
    public BaseResponse saveChildren(@RequestParam("parentId") String parentId,
                                     @RequestParam("names") List<String> names,
                                     @RequestParam(value = "type", required = false) String type) {
        BaseResponse response = null;
        try {

            response = appService.saveChildren(parentId, type, names);
        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping(value = "checkCode", method = RequestMethod.POST)
    public BaseResponse checkCode(@RequestParam(value = "mobile") String mobile,
                                  @RequestParam(value = "code") String code) {
        BaseResponse response;
        try {
            response = appService.checkCode(mobile, code);


        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }


    @ResponseBody
    @RequestMapping("appuser/loginByCode")
    public BaseResponse loginByCode(@RequestParam("mobile") String mobile,
                                    @RequestParam("code") String code) {
        BaseResponse response;
        String exc = null;
        try {
            response = appService.loginByCode(mobile, code);
        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }

        logService.addRemoteLogRecord(null, null, null, null, "app/appuser/loginByCode", response.getMessage(), exc, "LOGIN", "USER_LOGIN", mobile, null, null, null, null, null, null);

        return response;
    }

    @RequestMapping(value = "appuser/getCode")
    @ResponseBody
    public BaseResponse getCode(@RequestParam("mobile") String mobile, @RequestParam(value = "type", required = false) String type) {
        BaseResponse response;
        try {
            response = appService.generateCode(mobile, type);

        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
            logger.error(ex.toString());
        }
        return response;
    }

    @RequestMapping(value = "appuser/checkMobile11")
    @ResponseBody
    public BaseResponse checkMobile(@RequestParam("mobile") String mobile) {
        BaseResponse response;
        String exc = null;
        try {
            response = appService.checkAppUserMobile(mobile);

        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
            logger.error(ex.toString());
        }

        logService.addRemoteLogRecord(null, null, null, null, "app/appuser/checkMobile", response.getMessage(), exc, "LOGIN", "USER_LOGIN", mobile, null, null, null, null, null, null);

        return response;
    }

    @RequestMapping(value = "appuser/checkMobileV1")
    @ResponseBody
    public BaseResponse checkAppUserMobile240925(@RequestParam("mobile") String mobile,@RequestParam("deptName")String deptName) {
        BaseResponse response;
        String exc = null;
        try {
            response = appService.addOrUpdateAppUser240925(mobile,deptName);

        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
            logger.error(ex.toString());
        }

        logService.addRemoteLogRecord(null, null, null, null, "app/appuser/checkMobileV1", response.getMessage(), exc, "LOGIN", "USER_LOGIN", mobile, null, null, null, null, null, null);

        return response;
    }


    @RequestMapping(value = "appuser/checkMobileV2")
    @ResponseBody
    public BaseResponse checkAppUserMobile240929(@RequestParam("mobile") String mobile,@RequestParam("deptId")String deptId) {
        BaseResponse response;
        String exc = null;
        try {
            response = appService.addOrUpdateAppUser240929(mobile,deptId);

        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
            logger.error(ex.toString());
        }

        logService.addRemoteLogRecord(null, null, null, null, "app/appuser/checkMobileV2", response.getMessage(), exc, "LOGIN", "USER_LOGIN", mobile, null, null, null, null, null, null);

        return response;
    }




    @RequestMapping("/getDictsByCode")
    @ResponseBody
    public BaseResponse getDictsByCode(String code) {
        BaseResponse response = new BaseResponse();
        try {
            List<Dict> list = appService.getDictsByCode(code);
            response.setStatus(0);
            response.setData(list);

        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @RequestMapping("/getDictByCode")
    @ResponseBody
    public BaseResponse getDictByCode(String code) {
        BaseResponse response = new BaseResponse();
        try {
            String sql = "select * from tbl_dict where code = :code";
            Map<String, Object> params = new HashMap<>();
            params.put("code", code);
            Dict dict = appService.getBySql(sql, params, Dict.class);
            response.setStatus(0);
            response.setData(dict);

        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping(value = "user/login", method = RequestMethod.POST)
    public BaseResponse login(@RequestParam(value = "loginName", required = false) String loginName,
                              @RequestParam(value = "password", required = false) String password,
                              @RequestParam(value = "mac", required = false) String mac,
                              @RequestParam(value = "ip", required = false) String ip,
                              @RequestParam(value = "device", required = false) String device,
                              @RequestParam(value = "locX", required = false) String locX,
                              @RequestParam(value = "locY", required = false) String locY,
                              @RequestParam(value = "location", required = false) String location) {
        BaseResponse response;
        String exc = null;
        String userId = null;

        try {

            response = appService.loginByPwd(loginName, password);
            if (response.getStatus() == 0) {
                Map<String, Object> user = (Map<String, Object>) response.getData();
                userId = user.get("id").toString();

            }
        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        logService.addRemoteLogRecord(mac, ip, device, userId, "app/user/login", response.getMessage(), exc, "LOGIN", "PC_LOGIN", loginName, null, null, null, locX, locY, location);

        return response;
    }

    @ResponseBody
    @RequestMapping(value = "/getImageCode")
    public BaseResponse getImageCode() {
        BaseResponse response = null;
        try {

            response = appService.getImageCode();
        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }


    @ResponseBody
    @RequestMapping(value = "user/loginNew", method = RequestMethod.POST)
    public BaseResponse loginAndCheckImageCode(@RequestParam("uuid") String uuid,
                                               @RequestParam("code") String code,
                                               @RequestParam(value = "loginName", required = false) String loginName,
                                               @RequestParam(value = "password", required = false) String password,
                                               @RequestParam(value = "mac", required = false) String mac,
                                               @RequestParam(value = "ip", required = false) String ip,
                                               @RequestParam(value = "device", required = false) String device,
                                               @RequestParam(value = "locX", required = false) String locX,
                                               @RequestParam(value = "locY", required = false) String locY,
                                               @RequestParam(value = "location", required = false) String location) {
        BaseResponse response;
        String exc = null;
        String userId = null;

        try {
            if (StringUtils.isNotEmpty(code)) {
                response = appService.checkImageCode(uuid, code);
                if (response.getStatus() != 0) {
                    return response;
                }
            }


            response = appService.loginByPwd(loginName, password);
            if (response.getStatus() == 0) {
                Map<String, Object> user = (Map<String, Object>) response.getData();
                userId = user.get("id").toString();

            }
        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        logService.addRemoteLogRecord(mac, ip, device, userId, "app/user/login", response.getMessage(), exc, "LOGIN", "PC_LOGIN", loginName, null, null, null, locX, locY, location);

        return response;
    }

    @ResponseBody
    @RequestMapping(value = "login", method = RequestMethod.POST)
    public BaseResponse login(@RequestParam(value = "mobile", required = false) String mobile,
                              @RequestParam(value = "password", required = false) String password,
                              @RequestParam(value = "code", required = false) String code,
                              @RequestParam(value = "token", required = false) String token,
                              @RequestParam(value = "mac", required = false) String mac,
                              @RequestParam(value = "ip", required = false) String ip,
                              @RequestParam(value = "device", required = false) String device,
                              @RequestParam(value = "locX", required = false) String locX,
                              @RequestParam(value = "locY", required = false) String locY,
                              @RequestParam(value = "location", required = false) String location) {
        BaseResponse response;
        String exc = null;
        String userId = null;
        try {
            System.out.println(mobile);
            System.out.println(password);
            System.out.println(code);
            if (StrUtil.isNotEmpty(mobile)) {
                mobile = mobile.trim();
            }
            response = appService.login(mobile, code, password, token);
            if (response.getStatus() == 0) {
                Map<String, Object> user = (Map<String, Object>) response.getData();
                userId = user.get("id").toString();

            }

        } catch (Exception ex) {
            ex.printStackTrace();
            exc = ex.getMessage();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        logService.addRemoteLogRecord(mac, ip, device, userId, "app/login", response.getMessage(), exc, "LOGIN", "EMP_LOGIN", mobile, null, code, null, locX, locY, location);
        return response;
    }

    @ResponseBody
    @RequestMapping(value = "addNotice", method = RequestMethod.POST)
    public BaseResponse addNotice(Notice notice, MultipartFile imageFile, MultipartFile videoFile, HttpServletRequest request) {
        BaseResponse response;
        try {

            response = appService.addNotice(notice, imageFile, videoFile, request);

        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping(value = "editNotice", method = RequestMethod.POST)
    public BaseResponse editNotice(Notice notice, HttpServletRequest request) {
        BaseResponse response;
        try {

            response = appService.addNotice(notice, null, null, request);

        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping(value = "getNotice", method = RequestMethod.POST)
    public BaseResponse getNotice(Integer id) {
        BaseResponse response;
        try {

            response = appService.getNotice(id);

        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping(value = "deleteNotice", method = RequestMethod.POST)
    public BaseResponse deleteNotice(Integer id) {
        BaseResponse response;
        try {

            response = appService.deleteNotice(id);

        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping("getNoticeList")
    public BaseResponse getNoticeList(@RequestParam(value = "type", required = false) String type,
                                      @RequestParam(value = "status", required = false) String status,
                                      @RequestParam(value = "keyword", required = false) String keyword,
                                      @RequestParam(value = "startTime", required = false) String startTime,
                                      @RequestParam(value = "endTime", required = false) String endTime,
                                      @RequestParam(value = "pageNum", required = false) Integer pageNum,
                                      @RequestParam(value = "pageSize", required = false) Integer pageSize) {
        BaseResponse response = null;
        try {
            response = appService.getNoticeList(type, status, keyword, startTime, endTime, pageNum, pageSize);

        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping(value = "editNews", method = RequestMethod.POST)
    public BaseResponse editNews(News news, HttpServletRequest request) {
        BaseResponse response;
        try {

            response = appService.addNews(news, null, null, request);

        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping(value = "getNews", method = RequestMethod.POST)
    public BaseResponse getNews(Integer id) {
        BaseResponse response;
        try {

            response = appService.getNews(id);

        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping(value = "deleteNews", method = RequestMethod.POST)
    public BaseResponse deleteNews(Integer id) {
        BaseResponse response;
        try {

            response = appService.deleteNews(id);

        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping("getNewsList")
    public BaseResponse getNewsList(@RequestParam(value = "type", required = false) String type,
                                    @RequestParam(value = "isshow", required = false) String isshow,
                                    @RequestParam(value = "status", required = false) String status,
                                    @RequestParam(value = "keyword", required = false) String keyword,
                                    @RequestParam(value = "startTime", required = false) String startTime,
                                    @RequestParam(value = "endTime", required = false) String endTime,
                                    @RequestParam(value = "pageNum", required = false) Integer pageNum,
                                    @RequestParam(value = "pageSize", required = false) Integer pageSize) {
        BaseResponse response = null;
        try {
            response = appService.getNewsList(type, isshow, status, keyword, startTime, endTime, pageNum, pageSize);

        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping("getAreas")
    public BaseResponse getAreas(String code) {
        BaseResponse response;
        try {
            response = appService.getArea(code);

        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping("getAreaTree")
    public BaseResponse getAreaTree() {
        BaseResponse response;
        try {
            response = appService.getAreaTree();

        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }


    @ResponseBody
    @RequestMapping(value = "editAppNote", method = RequestMethod.POST)
    public BaseResponse editAppNote(AppNote expense) {
        BaseResponse response;
        try {

            response = appService.editAppNote(expense);

        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping(value = "getAppNote")
    public BaseResponse getAppNote(String id) {
        BaseResponse response;
        try {

            response = appService.getAppNote(id);

        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping(value = "deleteAppNote", method = RequestMethod.POST)
    public BaseResponse deleteAppNote(String id) {
        BaseResponse response;
        try {

            response = appService.deleteAppNote(id);

        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping("getAppNoteList")
    public BaseResponse getAppNoteList(
            String userId, String deptId,
            @RequestParam(value = "keyword", required = false) String keyword,
            @RequestParam(value = "startTime", required = false) String startTime,
            @RequestParam(value = "endTime", required = false) String endTime,
            @RequestParam(value = "pageNum", required = false) Integer pageNum,
            @RequestParam(value = "pageSize", required = false) Integer pageSize) {
        BaseResponse response = null;
        try {
            response = appService.getAppNoteList(userId, deptId, keyword, startTime, endTime, pageNum, pageSize);

        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping("getAppNoteCalender")
    public BaseResponse getAppNoteCalender(
            @RequestParam("userId") String userId,
            @RequestParam("month") String month,
            @RequestParam(value = "deptId", required = false) String deptId) {
        BaseResponse response = null;
        try {
            response = appService.getAppNoteCalender(userId, deptId, month);

        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }


    @ResponseBody
    @RequestMapping("editHelp")
    public BaseResponse editHelp(AppHelp help) {
        BaseResponse response;
        try {
            response = appService.editHelp(help);

        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙！");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping("getHelpList")
    public BaseResponse getHelpList(
            String type, String keyword, String status, String startTime, String endTime,
            @RequestParam(value = "pageNum", required = false) Integer pageNum,
            @RequestParam(value = "pageSize", required = false) Integer pageSize) {
        BaseResponse response;
        try {

            response = appService.getHelpList(type, keyword, status, startTime, endTime, pageNum, pageSize);


        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙！");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping("getHelp")
    public BaseResponse getHelp(
            @RequestParam("id") String id) {
        BaseResponse response;
        try {

            response = appService.getHelp(id);


        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙！");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping("deleteHelp")
    public BaseResponse deleteHelp(
            @RequestParam("id") String id) {
        BaseResponse response = new BaseResponse();
        try {
            AppHelp help = appService.get(AppHelp.class, id);
            if (help == null) {
                response.setStatus(1);
                response.setMessage("数据不存在！");
                return response;
            }
            appService.delete(help);

        } catch (Exception ex) {
            ex.printStackTrace();
            response.setStatus(1);
            response.setMessage("系统繁忙！");
        }
        return response;
    }


    @ResponseBody
    @RequestMapping("getItemChangeRecordListByAuth")
    public BaseResponse getItemChangeRecordListByAuth(
            @RequestParam("token") String token,
            @RequestParam(value = "type", required = false) String type,
            @RequestParam(value = "keyword", required = false) String keyword,
            @RequestParam(value = "startTime", required = false) String startTime,
            @RequestParam(value = "endTime", required = false) String endTime,
            @RequestParam(value = "pageNum", required = false) Integer pageNum,
            @RequestParam(value = "pageSize", required = false) Integer pageSize) {
        BaseResponse response = null;
        try {
            response = appService.checkToken(token);
            if (response.getStatus() != 0) {
                return response;
            }
            Map<String, Object> user = (Map<String, Object>) response.getData();
            String empId = user.get("id").toString();

            response = appService.getItemChangeRecordListByAuth(empId, type, keyword, startTime, endTime, pageNum, pageSize);

        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping("getItemChangeRecordList")
    public BaseResponse getItemChangeRecordList(
            String empId, String type,
            @RequestParam(value = "keyword", required = false) String keyword,
            @RequestParam(value = "startTime", required = false) String startTime,
            @RequestParam(value = "endTime", required = false) String endTime,
            @RequestParam(value = "pageNum", required = false) Integer pageNum,
            @RequestParam(value = "pageSize", required = false) Integer pageSize) {
        BaseResponse response = null;
        try {
            response = appService.getItemChangeRecordList(empId, type, keyword, startTime, endTime, pageNum, pageSize);

        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping(value = "getItemChangeRecord")
    public BaseResponse getItemChangeRecord(String id) {
        BaseResponse response;
        try {

            response = appService.getItemChangeRecord(id);

        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping(value = "deleteItemChangeRecord", method = RequestMethod.POST)
    public BaseResponse deleteItemChangeRecord(String id) {
        BaseResponse response;
        try {

            response = appService.deleteItemChangeRecord(id);

        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping(value = "deleteItemChangeRecords", method = RequestMethod.POST)
    public BaseResponse deleteItemChangeRecords(@RequestParam("ids") List<String> ids) {
        BaseResponse response;
        try {

            response = appService.deleteItemChangeRecords(ids);

        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }


    @ResponseBody
    @RequestMapping(value = "editUserFile", method = RequestMethod.POST)
    public BaseResponse editUserFile(UserFile userFile) {
        BaseResponse response;
        try {

            response = appService.editUserFile(userFile);

        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping(value = "getUserFile")
    public BaseResponse getUserFile(String id) {
        BaseResponse response;
        try {

            response = appService.getUserFile(id);

        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping(value = "deleteUserFile", method = RequestMethod.POST)
    public BaseResponse deleteUserFile(String id) {
        BaseResponse response;
        try {

            response = appService.deleteUserFile(id);

        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping("getUserFileList")
    public BaseResponse getUserFileList(
            @RequestParam(value = "keyword", required = false) String keyword,
            @RequestParam(value = "userId", required = false) String userId,
            @RequestParam(value = "type", required = false) String type,
            @RequestParam(value = "startTime", required = false) String startTime,
            @RequestParam(value = "endTime", required = false) String endTime,
            @RequestParam(value = "pageNum", required = false) Integer pageNum,
            @RequestParam(value = "pageSize", required = false) Integer pageSize) {
        BaseResponse response = null;
        try {
            response = appService.getUserFileList(keyword, userId, type, startTime, endTime, pageNum, pageSize);

        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }


    @ResponseBody
    @RequestMapping(value = "addTagChangeRecord", method = RequestMethod.POST)
    public BaseResponse addTagChangeRecord(TagChangeRecord tagChangeRecord) {
        BaseResponse response;
        try {

            response = appService.addTagChangeRecord(tagChangeRecord);

        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping(value = "getTagChangeRecord")
    public BaseResponse getTagChangeRecord(String id) {
        BaseResponse response;
        try {

            response = appService.getTagChangeRecord(id);

        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping(value = "deleteTagChangeRecord", method = RequestMethod.POST)
    public BaseResponse deleteTagChangeRecord(String id) {
        BaseResponse response;
        try {

            response = appService.deleteTagChangeRecord(id);

        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping(value = "deleteTagChangeRecords", method = RequestMethod.POST)
    public BaseResponse deleteTagChangeRecords(@RequestParam("ids") List<String> ids) {
        BaseResponse response;
        try {

            response = appService.deleteTagChangeRecords(ids);

        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping("getTagChangeRecordList")
    public BaseResponse getTagChangeRecordList(
            @RequestParam(value = "userId", required = false) String userId,
            @RequestParam(value = "deptId", required = false) String deptId,
            @RequestParam(value = "changeType", required = false) String changeType,
            @RequestParam(value = "type", required = false) String type,
            @RequestParam(value = "itemId", required = false) String itemId,
            @RequestParam(value = "keyword", required = false) String keyword,
            @RequestParam(value = "state", required = false) String state,
            @RequestParam(value = "shUserId", required = false) String shUserId,
            @RequestParam(value = "startTime", required = false) String startTime,
            @RequestParam(value = "endTime", required = false) String endTime,
            @RequestParam(value = "pageNum", required = false) Integer pageNum,
            @RequestParam(value = "pageSize", required = false) Integer pageSize) {
        BaseResponse response = null;
        try {
            response = appService.getTagChangeRecordList(userId, deptId, changeType, type, itemId, keyword, state, shUserId, startTime, endTime, pageNum, pageSize);

        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping(value = "verifyTagChangeRecord", method = RequestMethod.POST)
    public BaseResponse verifyTagChangeRecord(@RequestParam("userId") String userId,
                                              @RequestParam("id") String id,
                                              @RequestParam("state") int state,
                                              @RequestParam(value = "reason", required = false) String reason) {
        BaseResponse response;
        try {

            response = appService.updateTagChangeRecordState(userId, id, state, reason);


        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping(value = "getTagChangeDAList", method = RequestMethod.POST)
    public BaseResponse getTagChangeDAList(@RequestParam("year") String year,
                                           @RequestParam("month") String month) {
        BaseResponse response;
        try {

            response = appService.getTagChangeDAList(year, month);


        } catch (Exception ex) {
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }


    @RequestMapping("/resetUserPwd")
    @ResponseBody
    public BaseResponse resetUserPwd(@RequestParam("token") String token, @RequestParam(value = "userIds", required = false) List<String> userIds) {

        BaseResponse response = null;
        try {
            BaseResponse baseResponse = appService.checkEmpToken(token);
            if (baseResponse.getStatus() == 0) {

                Map<String, Object> user = (Map<String, Object>) baseResponse.getData();
                String empId = user.get("id").toString();
                logger.error("resetUserPwd:" + empId);
                response = appService.resetUserPwd(userIds);

            }


        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }


    @RequestMapping("/test")
    @ResponseBody
    public BaseResponse test() {

        BaseResponse response = new BaseResponse();
        try {
            String sql = "select survey_id,user_id,count(*) cnt from t_survey_answer where createDate>'2024' group by survey_id,user_id";
            List<Map<String, Object>> list = appService.findMapBySql(sql);
            response.setData(list);


        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();

            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @RequestMapping("/addAnswerTemp")
    @ResponseBody
    public BaseResponse addAnswerTemp() {

        BaseResponse response = null;
        try {
            response = appService.addAnswerTemp();

        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @RequestMapping("/updateAnswerTempUserInfo")
    @ResponseBody
    public BaseResponse updateAnswerTempUserInfo() {

        BaseResponse response = null;
        try {
            response = appService.updateAnswerTempUserInfo();

        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @RequestMapping("appuser/getWjList11")
    @ResponseBody
    public BaseResponse getWjList(@RequestParam("token") String token) {

        BaseResponse response = null;
        try {

            response = appService.checkToken(token);
            if (response.getStatus() == 0) {

                Map<String, Object> user = (Map<String, Object>) response.getData();
                String userId = user.get("id").toString();
                logger.error("getWjList:" + userId);
                response = appService.getWjList(userId);

            }


        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @RequestMapping("appuser/getWjListV1")
    @ResponseBody
    public BaseResponse getWjList240925(@RequestParam("token") String token) {

        BaseResponse response = null;
        try {

            response = appService.checkToken(token);
            if (response.getStatus() == 0) {

                Map<String, Object> user = (Map<String, Object>) response.getData();
                String userId = user.get("id").toString();
                String userName = user.get("mobile").toString();
                logger.error("getWjListV1:" + userId+":"+userName);
                response = appService.getWjList240925(userId);

            }


        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }


    @RequestMapping("getWjHistoryList")
    @ResponseBody
    public BaseResponse getWjHistoryList(@RequestParam("token") String token) {

        BaseResponse response = null;
        try {

            response = appService.checkEmpToken(token);
            if (response.getStatus() == 0) {

                Map<String, Object> user = (Map<String, Object>) response.getData();
                String userId = user.get("id").toString();
                String name = user.get("name").toString();
                logger.error("getWjHistoryList:" + userId+"/"+name);

                String sql = "select d.id,d.name,d.`code`,d.`value`,d.valuex,d.valuey from tbl_dict d left join tbl_dict p on p.id=d.parent_id " +
                        "where p.code = :code and d.deleted=0 " +
                        "order by d.levelCode desc ";
                Map<String, Object> params = new HashMap<>();
                params.put("code","wjlb");
                List<Map<String, Object>> data = appService.findMapBySql(sql, params);
                response.setData(data);
            }


        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @RequestMapping("appuser/saveWj11")
    @ResponseBody
    public BaseResponse saveWj(@RequestBody AppWjResult wjResult) {

        BaseResponse response = null;
        try {
            logger.error("saveWj:" + new Gson().toJson(wjResult));
            response = appService.saveWj(wjResult);


        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @RequestMapping("appuser/saveWjV1")
    @ResponseBody
    public BaseResponse saveWj240925(@RequestBody AppWjResult wjResult) {

        BaseResponse response = null;
        try {
            logger.error("saveWjV1:" + new Gson().toJson(wjResult));
            response = appService.saveWj240925(wjResult);


        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }


    @ResponseBody
    @RequestMapping("getWjResultList")
    public BaseResponse getWjResultList(
            @RequestParam("token") String token,
            @RequestParam(value = "userId", required = false) String userId,
            @RequestParam(value = "wjCode", required = false) String wjCode,
            @RequestParam(value = "pointMin", required = false) Integer pointMin,
            @RequestParam(value = "pointMax", required = false) Integer pointMax,
            @RequestParam(value = "deptId", required = false) String deptId,
            @RequestParam(value = "type", required = false) String type,
            @RequestParam(value = "state", required = false) String state,
            @RequestParam(value = "keyword", required = false) String keyword,
            @RequestParam(value = "startTime", required = false) String startTime,
            @RequestParam(value = "endTime", required = false) String endTime,
            @RequestParam(value = "pageNum", required = false) Integer pageNum,
            @RequestParam(value = "pageSize", required = false) Integer pageSize) {
        BaseResponse response = null;
        try {
            response = appService.checkEmpToken(token);
            if (response.getStatus() != 0) {
                return response;
            }

            response = appService.getWjResultList(userId, wjCode, pointMin, pointMax, deptId, type, state, keyword, startTime, endTime, pageNum, pageSize);

        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping("getWjResultItemList")
    public BaseResponse getWjResultItemList(
            @RequestParam("token") String token,
            @RequestParam(value = "mainId", required = false) String mainId,
            @RequestParam(value = "userId", required = false) String userId,
            @RequestParam(value = "wjCode", required = false) String wjCode,
            @RequestParam(value = "pointMin", required = false) Integer pointMin,
            @RequestParam(value = "pointMax", required = false) Integer pointMax,
            @RequestParam(value = "deptId", required = false) String deptId,
            @RequestParam(value = "type", required = false) String type,
            @RequestParam(value = "state", required = false) String state,
            @RequestParam(value = "keyword", required = false) String keyword,
            @RequestParam(value = "startTime", required = false) String startTime,
            @RequestParam(value = "endTime", required = false) String endTime,
            @RequestParam(value = "pageNum", required = false) Integer pageNum,
            @RequestParam(value = "pageSize", required = false) Integer pageSize) {
        BaseResponse response = null;
        try {
            response = appService.checkEmpToken(token);
            if (response.getStatus() != 0) {
                return response;
            }

            Map<String, Object> user = (Map<String, Object>) response.getData();
            String empId = user.get("id").toString();
            String empName = user.get("name").toString();
            logger.error("getWjResultItemList:" + userId+":"+empName);
            response.setData(null);

            response = appService.getWjResultItemList(mainId,userId, wjCode, pointMin, pointMax, deptId, type, state, keyword, startTime, endTime, pageNum, pageSize);

        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @RequestMapping("getWjResult")
    @ResponseBody
    public BaseResponse getWjResult(@RequestParam("token") String token, @RequestParam("id") String id) {

        BaseResponse response = null;
        try {

            response = appService.checkEmpToken(token);
            if (response.getStatus() == 0) {

                Map<String, Object> user = (Map<String, Object>) response.getData();
                String userId = user.get("id").toString();
                logger.error("getWjResult:" + userId);
                response = appService.getWjResult(id);

            }


        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @RequestMapping("getWjResultV1")
    @ResponseBody
    public BaseResponse getWjResult240925(@RequestParam("token") String token, @RequestParam("id") String id) {

        BaseResponse response = null;
        try {

            response = appService.checkEmpToken(token);
            if (response.getStatus() == 0) {

                Map<String, Object> user = (Map<String, Object>) response.getData();
                String userId = user.get("id").toString();
                String userName = user.get("name").toString();
                logger.error("getWjResultV1:" + userId+":"+userName);
                response = appService.getWjResult240925(id);

            }


        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }


    /*每个单位总体情况*/
    @RequestMapping("getWjResultDA1")
    @ResponseBody
    public BaseResponse getWjResultDA1(@RequestParam("token") String token, String wjCode, String startTime, String endTime) {

        BaseResponse response = null;
        try {

            response = appService.checkEmpToken(token);
            if (response.getStatus() != 0) {
                return response;
            }

            response = appService.getWjResultDA1(wjCode, startTime, endTime);


        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    /*每个单位总体情况*/
    @RequestMapping("exportWjResultDA1")
    @ResponseBody
    public void exportWjResultDA1(@RequestParam("token") String token, String wjCode, String startTime, String endTime, HttpServletResponse response) {

        appService.exportWjResultDA1(token, wjCode, startTime, endTime, response);

    }

    /*分项数据，按单位分解*/
    @RequestMapping("getWjResultDA2")
    @ResponseBody
    public BaseResponse getWjResultDA2(@RequestParam("token") String token, String wjCode, String startTime, String endTime, String dt) {

        BaseResponse response = null;
        try {

            response = appService.checkEmpToken(token);
            if (response.getStatus() != 0) {
                return response;
            }
            if ("1".equals(dt)) {
                response = appService.getWjResultDAAll2(wjCode, startTime, endTime);
            } else {
                response = appService.getWjResultDA2(wjCode, startTime, endTime);
            }


        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @RequestMapping("exportWjResultDA2")
    @ResponseBody
    public void exportWjResultDA2(@RequestParam("token") String token, String wjCode, String startTime, String endTime, String dt, HttpServletResponse response) {
        if ("1".equals(dt)) {
            appService.exportWjResultDAAll2(token, wjCode, startTime, endTime, response);
        }else {
            appService.exportWjResultDA2(token, wjCode, startTime, endTime, response);
        }

    }


    /*意见建议收集*/
    @RequestMapping("getWjResultDA3")
    @ResponseBody
    public BaseResponse getWjResultDA3(@RequestParam("token") String token, String wjCode, String startTime, String endTime) {

        BaseResponse response = null;
        try {

            response = appService.checkEmpToken(token);
            if (response.getStatus() != 0) {
                return response;
            }

            response = appService.getWjResultDA3(wjCode, startTime, endTime);


        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    /*意见建议收集 竖行*/
    @RequestMapping("getWjResultFinalTags")
    @ResponseBody
    public BaseResponse getWjResultFinalTags(@RequestParam("token") String token, String wjCode, String startTime, String endTime) {

        BaseResponse response = null;
        try {

            response = appService.checkEmpToken(token);
            if (response.getStatus() != 0) {
                return response;
            }

            response = appService.getWjResultFinalTags(wjCode, startTime, endTime);


        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @RequestMapping("getWjResultFinalTagsV1")
    @ResponseBody
    public BaseResponse getWjResultFinalTagsV1(@RequestParam("token") String token, String wjCode, String startTime, String endTime,String sortType) {

        BaseResponse response = null;
        try {

            response = appService.checkEmpToken(token);
            if (response.getStatus() != 0) {
                return response;
            }

            response = appService.getWjResultFinalTags241012(wjCode, startTime, endTime,sortType);


        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping("getAppUserList")
    public BaseResponse getAppUserList(
            @RequestParam("token") String token,
            @RequestParam(value = "deptId", required = false) String deptId,
            @RequestParam(value = "type", required = false) String type,
            @RequestParam(value = "keyword", required = false) String keyword,
            @RequestParam(value = "startTime", required = false) String startTime,
            @RequestParam(value = "endTime", required = false) String endTime,
            @RequestParam(value = "pageNum", required = false) Integer pageNum,
            @RequestParam(value = "pageSize", required = false) Integer pageSize) {
        BaseResponse response = null;
        try {
            response = appService.checkEmpToken(token);
            if (response.getStatus() != 0) {
                return response;
            }

            response = appService.getAppUserList(deptId, type, keyword, startTime, endTime, pageNum, pageSize);

        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @ResponseBody
    @RequestMapping("testGetLocation")
    public BaseResponse testGetLocation() {
        BaseResponse response = new BaseResponse();
        try {
            String shortUrl = "https://v.douyin.com/i6C17jnU/";
            Map params = new HashMap();
            Map<String,String> resultMap = HttpClient.restTemplatePostForLocation(shortUrl, params, null);
            logger.error(new Gson().toJson(resultMap));
            String encryptedData = resultMap.get("object_id");
            logger.error(new Gson().toJson("encryptedData:"+encryptedData));

        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();

            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }


    @RequestMapping("getWjResultDAByOptionForAll")
    @ResponseBody
    public BaseResponse getWjResultDAByOptionForAll(@RequestParam("token") String token,@RequestParam("wjCode") String wjCode, String startTime, String endTime) {

        BaseResponse response = null;
        try {

            response = appService.checkEmpToken(token);
            if (response.getStatus() != 0) {
                return response;
            }

            response = appService.getWjResultDAByOptionForAll(wjCode, startTime, endTime);


        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @RequestMapping("exportWjResultDAByOptionForAll")
    @ResponseBody
    public void exportWjResultDAByOptionForAll(@RequestParam("token") String token,@RequestParam("wjCode") String wjCode, String startTime, String endTime, HttpServletResponse response) {
        appService.exportWjResultDAByOptionForAll(token, wjCode, startTime, endTime, response);

    }

    @RequestMapping("getWjResultDAByOptionAndDept")
    @ResponseBody
    public BaseResponse getWjResultDAByOptionAndDept(@RequestParam("token") String token,@RequestParam("wjCode") String wjCode, String startTime, String endTime) {

        BaseResponse response = null;
        try {

            response = appService.checkEmpToken(token);
            if (response.getStatus() != 0) {
                return response;
            }

            response = appService.getWjResultDAByOptionAndDept(wjCode, startTime, endTime);


        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @RequestMapping("exportWjResultDAByOptionAndDept")
    @ResponseBody
    public void exportWjResultDAByOptionAndDept(@RequestParam("token") String token,@RequestParam("wjCode") String wjCode, String startTime, String endTime, String dt, HttpServletResponse response) {
        appService.exportWjResultDAByOptionAndDept(token, wjCode, startTime, endTime, response);

    }


    @RequestMapping("getWjUserDAByDept")
    @ResponseBody
    public BaseResponse getWjUserDAByDept(@RequestParam("token") String token,@RequestParam("wjCode") String wjCode, String startTime, String endTime) {

        BaseResponse response = null;
        try {

            response = appService.checkEmpToken(token);
            if (response.getStatus() != 0) {
                return response;
            }

            response = appService.getWjUserDAByDept(wjCode, startTime, endTime);


        } catch (Exception ex) {
            logger.error(ex.getMessage());
            ex.printStackTrace();
            response = new BaseResponse();
            response.setStatus(1);
            response.setMessage("系统繁忙");
        }
        return response;
    }

    @RequestMapping("exportWjResultDAInOne")
    @ResponseBody
    public void exportWjResultDAInOne(@RequestParam("token") String token, String wjCode, String startTime, String endTime, HttpServletRequest request, HttpServletResponse response) {
        appService.exportWjResultDAInOne(token, wjCode, startTime, endTime,request,  response);

    }

}
